home *** CD-ROM | disk | FTP | other *** search
/ Windows Expert / Windows Expert.iso / windownt / uupc11ys.zip / LIB / SCRSIZNT.C < prev    next >
C/C++ Source or Header  |  1993-04-10  |  2KB  |  52 lines

  1. /*
  2.  *    $Id: SCRSIZNT.C 1.4 1993/04/10 21:22:29 dmwatt Exp $
  3.  *
  4.  *    $Log: SCRSIZNT.C $
  5.  *     Revision 1.4  1993/04/10  21:22:29  dmwatt
  6.  *     Windows/NT fixes
  7.  *
  8.  *     Revision 1.3  1992/12/30  13:09:25  dmwatt
  9.  *     Correct boolean compare
  10.  *
  11.  */
  12.  
  13. /*--------------------------------------------------------------------*/
  14. /*                        System include files                        */
  15. /*--------------------------------------------------------------------*/
  16.  
  17. #include <stdio.h>
  18.  
  19. #include <windows.h>
  20.  
  21. /*--------------------------------------------------------------------*/
  22. /*                    UUPC/extended include files                     */
  23. /*--------------------------------------------------------------------*/
  24.  
  25. #include "lib.h"
  26. #include "scrsize.h"
  27.  
  28. /*--------------------------------------------------------------------*/
  29. /*    s c r s i z e                                                   */
  30. /*                                                                    */
  31. /*    Return screen size under Windows/NT                             */
  32. /*--------------------------------------------------------------------*/
  33.  
  34. short scrsize( void )
  35. {
  36.    CONSOLE_SCREEN_BUFFER_INFO info;
  37.    BOOL result;
  38.    HANDLE hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
  39.  
  40.    result = GetConsoleScreenBufferInfo(hStdout, &info);
  41.  
  42.    if ( result != TRUE )
  43.    {
  44.       printmsg(0,"Windows/NT error code %d retrieving console information",
  45.                GetLastError() );
  46.       return PAGESIZE;
  47.    }
  48.  
  49.    return info.dwSize.Y;
  50. } /* scrsize */
  51.  
  52.